import 'dart:convert' show json;

import 'inspiration_info_bean.dart';


T asT<T>(dynamic value) {
  if (value is T) {
    return value;
  }

  return null;
}

class InspirationContentBean {
  InspirationContentBean({
    this.code,
    this.data,
  });

  factory InspirationContentBean.fromJson(Map<String, dynamic> jsonRes) =>
      jsonRes == null
          ? null
          : InspirationContentBean(
        code: asT<int>(jsonRes['code']),
        data: Data.fromJson(asT<Map<String, dynamic>>(jsonRes['data'])),
      );

  int code;
  Data data;

  Map<String, dynamic> toJson() => <String, dynamic>{
    'code': code,
    'data': data,
  };
  @override
  String toString() {
    return json.encode(this);
  }
}

class Data {
  Data({
    this.results,
  });

  factory Data.fromJson(Map<String, dynamic> jsonRes) => jsonRes == null
      ? null
      : Data(
    results:
    InspirationInfo.fromJson(asT<Map<String, dynamic>>(jsonRes['results'])),
  );

  InspirationInfo results;

  Map<String, dynamic> toJson() => <String, dynamic>{
    'results': results,
  };
  @override
  String toString() {
    return json.encode(this);
  }
}




